package com.duqc.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.util.DigestUtils;

/**
 * @ClassName MD5Util
 * @Description MD5
 * @Author duqc
 * @Date 2021/5/8
 **/
@Slf4j
public class MD5Util {

    private MD5Util() {

    }

    /**
     * 加密
     *
     * @param content
     * @param salt
     * @return
     */
    public static String encryptByMD5(String content, String salt) {
        String base = content + "/" + salt;
        return DigestUtils.md5DigestAsHex(base.getBytes());
    }

    public static void main(String[] args) {
        log.info(encryptByMD5("duqc@2021","123"));
    }

}
